<script setup>
import { ref } from 'vue';

let counter = ref(0)

function descrease() {
    --counter.value
}

function increase() {
    ++counter.value
}

let event = ref("click")

</script>

<template>
    <h2>{{ counter }}</h2>


    <!-- 语法糖写法 -->
    <!-- <button @dblclick="descrease">-</button>
    <button @dblclick="increase">+</button> -->

    <button @[event]="descrease">-</button>
    <button @[event]="increase">+</button>
</template>

<style lang="css" scoped></style>